package com.mo.ld.activity.interactive

import android.os.Bundle
import com.mo.ld.databinding.ActProscessBinding
import com.mo.lib.ui.activity.BaseVbActivity
import com.mo.lib.utils.getProcessName
import com.mo.lib.utils.intentExtrasString
import com.mo.lib.utils.setClick

/**
 * @ author：mo
 * @ data：2022/4/26:9:33
 * @ 功能：
 */
class ProscessesActivityOne : BaseVbActivity<ActProscessBinding>() {
    override fun initView(savedInstanceState: Bundle?) {
        super.initView(savedInstanceState)
        getProcessName()?.let {
            viewBinding.tvActProcess.text = "当前进程：${it}"
        }
        viewBinding.tvActProcessIntent.setClick { //          startActivity<ProscessesActivityTwo>("")
            com.mo.lib.utils.startActivity<ProscessesActivityTwo>(getProcessName()!!.toString())
        }

    }

    override fun initData() {
    }
}

class ProscessesActivityTwo : BaseVbActivity<ActProscessBinding>() {
    private val name: String? by intentExtrasString()
    override fun initView(savedInstanceState: Bundle?) {
        super.initView(savedInstanceState)
        getProcessName()?.let {
            viewBinding.tvActProcess.text = "当前进程：${it}"
        }
    }

    override fun initData() {
        name?.let {
            viewBinding.tvActProcessIntent.text = "从  ${name}  进程通过   Intent   传过来了数据"
        }
    }
}


